package com.zlf.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName DemoController
 * @Description TODO
 * @Author zlf
 * @Date 2021/5/22 12:39
 */
@RestController
public class DemoController {

    Logger log = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/test1")
    public String test1() {
        log.info("这里是SleuthZipkinServer01");
        return restTemplate.getForObject("http://127.0.0.1:6002/test1", String.class);
    }

    @GetMapping("/test2")
    public String test2() {
        log.info("这里是SleuthZipkinServer01");
        return restTemplate.getForObject("http://127.0.0.1:6002/test2", String.class);
    }

}
